<template>
  <div class="main">
    <div  class="container">
        <div class="container-content">
            <div class="container-top">
                <div class="top">
                    <div class="title">申报项目审核</div>
                    <div class="oper">
                        <el-button type="primary" class="close" icon="iconfont icon-guanbi" @click="back">关闭</el-button>
                    </div>
                </div>
            </div>
            <div class="content">
                <div class="tableScore">
                    <div class="head">
                        <div class="title">评分指标</div>
                        <div class="title">评分标准</div>
                        <div class="title">评分</div>
                    </div>
                    <div v-for="(item, index) in assessList" :key="index">
                        <div class="tableTitle title">{{item.name}}</div>
                        <div class="tableContent">
                            <div>
                                <div v-for="(child, idx) in item.children" :key="idx" class="tableContent-item">
                                    <div>{{child.name}}:{{child.summary}}({{child.score}})</div>
                                    <div>
                                        {{child.scoreing === -1 ? '': child.scoreing }}
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <table>
                    <tr>
                        <th style="width: 100%;" colspan="12">
                            最终得分：<span>{{scoredetail.score_total}}</span>
                        </th>
                    </tr>
                    <tr>
                        <th>评语：</th>
                        <td colspan="12" class="pingyu">
                            {{scoredetail.remark}}
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
  </div>
</template>
<script>
import _ from 'lodash'
import { ExpertDetails } from '@/api/login'
export default {
  name: 'ShenBaoDetails',
  data () {
    return {
        contentList: '',
        assessList:'',
        Showbg: false,
        scoredetail: [],
        id: '',
        token: '',
    }
  },
  methods: {
    // 获取评审指标详情
    queryExpertDetails(){
        ExpertDetails({
            token: this.token,
            de_id: this.id
        }).then((result)=>{
            const {data} = result;
            const {assess} = data;
            this.scoredetail = assess;
            this.assessList = assess.list;
            if(result.msg === '数据不存在'){
              this.$router.push({
                path: '/dataError'
              })
            }else if(result.msg === '项目已过期'){
              this.$router.push({
                path: '/overdueError'
              })
            }
            if(result.code === -1){
              this.$router.push({
                path: '/rootError'
              })
            }
        })
    },
    back(){
        this.$router.go(-1)
    },
    backgroundShow(){
        this.$emit('backgroundShow',this.Showbg)
    }
  },
  created(){
    this.backgroundShow()
  },
  mounted(){
    const token = sessionStorage.getItem('token');
    const id = this.$route.query.id;
    this.token = token;
    this.id = id;
    // console.log(this.token);
    this.queryExpertDetails();
  }
}
</script>
<style lang='scss' scoped>
.main{
    font-family: 'Avenir', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding: 0;
    color: #242748;
    margin: 0 auto;
    position: relative;
    font-size: 18px;
    margin: 0 50px 20px 30px;
    text-align: left;
    font-family: "PingFang";
    .container{
        display: flex;
        justify-content: space-between;
        &>div{
            background-color: #fff;
            border-radius: 5px;
        }
    }
    .container{
        height: 980px;
        overflow-y: auto;
        &>div{
            width: 100%;
            background-color: #fff;
            border-radius: 5px;
        }
        .preview{
          width: 50%!important;
          .details{
              width: 82%!important;
          }
        }
    }
    table{
        width: 100%;
    }
    .container-content{
        width: 100%
        table{
            width: 100%;
        }
        .tableScore{
            &>div{
                display: flex;
                border: solid 1px #ccc;
                border-bottom: none;
                .title{
                    border-right: solid 1px #ccc;
                    padding-left: 15px;
                    line-height: 60px;
                    font-weight: 700;
                    &:first-of-type{
                        width: 13%;
                    }
                    &:nth-child(2){
                        width: 73%;
                    }
                    &:last-of-type{
                        width: 10%;
                        border-right: none;
                    }
                }
                .tableContent{
                    width: calc(100% - 13%);
                    .tableContent-item{
                        display: flex;
                        border-bottom: solid 1px #ccc;
                        &:last-of-type{
                            border-bottom: none;
                        }
                        &>div{
                            padding: 5px 15px 15px;
                            line-height: 30px;
                        }
                        &>div:first-child{
                            color: #76818f;
                            text-align: justify;
                            width: 83.9%;
                            border-right: solid 1px #ccc;
                        }
                        &>div:last-child{
                            width: 12%;
                            border-bottom: none;
                        }
                    }
                }
            }
            .tableTitle{
                line-height: 35px!important;
            }
            /deep/.el-input__inner{
                border: none;
                padding: 0;
                width: 100%;
                font-size: 18px;
            }
            // th{
            //     border-bottom: none;
            //     border-right: none;
            //     /deep/.el-input__inner{
            //         border: none;
            //         padding: 0;
            //         width: 100%;
            //         font-size: 18px;
            //     }
            // }
            // td{
            //     border-bottom: none;
            //     border-right: none;
            // }
        }
        table td,th{
            border: solid 1px #ccc;
            padding: 15px;
            line-height: 35px;
            font-weight: 700;
        }
        table th:first-child{
            width: 13%;
            letter-spacing: 2px;
        }
        table th:last-child{
            width: 10%;
            border-right: solid 1px #ccc;
        }
        td{
            color: #76818f;
            text-align: justify;
            /deep/.el-form-item{
                height: 100%;
            }
            /deep/.el-form-item__content{
                height: 100%;
            }
            /deep/.el-textarea{
                height: 100%;
            }
            /deep/.el-textarea__inner{
                width: 100%;
                height: 100%;
                background-color: #f4f7fc;
                padding: 10px 18px;
                border-radius: 5px;
                color: #242748;
                font-size: 18px;
                font-family: "PingFang";
                border: none;
                resize: none;
                outline: none;
                &::placeholder{
                    color: #242748;
                    font-size: 18px;
                    font-family: "PingFang";
                }
            }
            /deep/.el-form-item{
                margin-bottom: 0;
            }
        }
        .pingyu{
            height: 210px;
        }
        th{
            span{
                color: #6a82fd;
                font-size: 30px;
                vertical-align: middle;
            }
        }
    }
    .container-top{
        .top{
            display: flex;
            justify-content: space-between;
            .title{
                    font-size: 26px;
                    font-family: "黑体";
                    color: #5673ff;
                    margin-right: 60px;
            }
            .oper{
                .shrink{
                    background-color: #69a1ff;
                    border: solid 1px #4d8df7;
                    box-shadow: 0px 4px 15.52px 0.48px rgba(73, 100, 245, 0.39);
                }
                /deep/.icon-zhankai{
                    font-size: 18px;
                }
            }
        }
        .contentTitle{
            font-size: 22px;
            color: #242748;
            line-height: 32px;
            font-weight: 700;
            p{
                font-weight: 700;
            }
        }
    }
    .container-top{
        padding: 33px 45px 25px;
        border-bottom: solid 1px #e7e9eb;
    }
    /deep/.close{
        border: solid 1px #e7e9eb;
        background-color: rgb(255, 255, 255);
        box-shadow: 0px 4px 15.52px 0.48px rgba(73, 100, 245, 0.14);
        color: #242748;
    }
    /deep/.el-button{
        width: 100px;
        height: 35px;
        line-height: 35px;
        padding: 0;
        i{
            margin-right: 8px;
            vertical-align: bottom;
        }
    }
    .content{
        padding: 40px;
        height: 830px;
        overflow-y: auto;
        font-size: 18px;
        .item{
            display: flex;
            margin-bottom: 60px;
            .chakan{
                display: inline-block;
                font-size: 12px;
                padding: 6px 12px;
                color: #fff;
                vertical-align: middle;
                margin-left: 30px;
                border-radius: 5px;
                background-color: #69a1ff;
                border: solid 1px #4d8df7;
            }
            &>p:first-child{
                width: 170px;
            }
            &>p:nth-child(2),&>div{
                width: calc(100% - 170px);
            }
            &:last-of-type{
                margin-bottom: 0;
            }
            .item-content{
                line-height: 25px;
            }
            .file-item{
                margin-bottom: 30px;
                &:last-of-type{
                    margin-bottom: 0;
                }
            }
        }
        .file{
            margin-bottom: 40px;
        }
        .preview{
          display: flex;
          align-items: center;
          width: 85%;
          margin: 20px 0 15px;
          padding: 20px 22px;
          background-color: #f4f7fc;
          border-radius: 5px;
          .img{
            width: 30px;
            height: 30px;
            vertical-align: middle;
            img{
              border-radius: 2px;
            }
          }
          .details{
            width: 75%;
            margin: 0 0 0 20px;
            .title{
              width: 90%;
              overflow: hidden;
              text-overflow: ellipsis;
              white-space: nowrap;
              color: #242748;
              font-size: 14px;
              font-weight: 700;
            }
            p{
              line-height: 22px;
              font-size: 12px;
              color: #a1a4b5;
              span{
                margin-right: 10px;
              }
            }
          }
          .preview-btn{
            &>div{
              float: left;
              width: 18px;
              height: 18px;
              margin-left: 18px;
            }
            .del{
              width: 16px;
            }
          }
        }
        .middle{
            height: 40px;
        }
    }
    /deep/.el-table{
      margin-bottom: 50px;
    }
    /deep/.dialog-footer{
      text-align: center;
    }
    /deep/input::-webkit-outer-spin-button, /deep/input::-webkit-inner-spin-button {
        -webkit-appearance: none!important;
        appearance: none!important;
        margin: 0;
    } 
    /* 火狐 */ 
    /deep/input{
      -moz-appearance:textfield;
    }
}
</style>